<template>
    <div class="default-page">
        <div class="default-content">
            <div class="header-left">
                <img src="@/assets/logo.png" alt="logo" class="logo">
                <span class="system-name">APIHub</span>
            </div>

            <div class="action-section" v-permission="'project:manage:center'">
                <button class="action-btn" @click="navigateDashboard">
                    <i class="iconfont icon-dash-board"></i>
                    点击跳转项目管理页面
                </button>
            </div>
        </div>
    </div>
</template>

<script setup>
import router from '@/router';
import { useRoute } from 'vue-router';

const route = useRoute();

const navigateDashboard = () => {
    router.push(`/project/${route.params.id}/admin-panel`);
};
</script>

<style lang="less" scoped>
// 默认页面样式
.default-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 40px;
    min-height: 100vh;
    animation: fadeInUp 0.8s ease-out;
    position: relative;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.05) 100%);
        pointer-events: none;
    }

    .default-content {
        text-align: center;
        max-width: 500px;
        width: 100%;
        position: relative;
        z-index: 1;

        .header-left {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
            gap: 24px;
            margin-bottom: 40px;

            .logo {
                width: 80px;
                height: 80px;
                border-radius: 16px;
                box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
                transition: transform 0.3s ease, box-shadow 0.3s ease;

                &:hover {
                    transform: translateY(-4px);
                    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
                }
            }

            .system-name {
                font-size: 32px;
                font-weight: 700;
                color: var(--primary-color);
                letter-spacing: 1px;
                transition: color 0.3s ease;
                background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent;
                background-clip: text;
            }
        }

        .action-section {
            margin-bottom: 40px;
            animation: fadeInUp 0.8s ease-out 0.6s both;

            .action-btn {
                display: inline-flex;
                align-items: center;
                gap: 16px;
                padding: 20px 40px;
                background: var(--primary-color);
                color: white;
                border: none;
                border-radius: 16px;
                font-size: 18px;
                font-weight: 600;
                cursor: pointer;
                transition: all 0.3s ease;
                box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
                position: relative;
                overflow: hidden;

                &::before {
                    content: '';
                    position: absolute;
                    top: 0;
                    left: -100%;
                    width: 100%;
                    height: 100%;
                    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
                    transition: left 0.5s ease;
                }

                i {
                    font-size: 24px;
                    transition: transform 0.3s ease;
                }

                &:hover {
                    background: var(--primary-light);
                    transform: translateY(-4px);
                    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);

                    &::before {
                        left: 100%;
                    }

                    i {
                        transform: scale(1.1);
                    }
                }

                &:active {
                    transform: translateY(-2px);
                }
            }
        }
    }
}

// 动画定义
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

// 响应式设计
@media (max-width: 768px) {
    .default-page {
        padding: 24px;

        .default-content {
            max-width: 100%;

            .header-left {
                gap: 20px;

                .logo {
                    width: 64px;
                    height: 64px;
                }

                .system-name {
                    font-size: 24px;
                }
            }

            .action-section .action-btn {
                padding: 16px 32px;
                font-size: 16px;
            }
        }
    }
}

@media (max-width: 480px) {
    .default-page {
        padding: 16px;

        .default-content {
            .header-left {
                gap: 16px;
                margin-bottom: 32px;

                .logo {
                    width: 56px;
                    height: 56px;
                }

                .system-name {
                    font-size: 20px;
                }
            }

            .action-section .action-btn {
                padding: 14px 28px;
                font-size: 15px;
                gap: 12px;

                i {
                    font-size: 20px;
                }
            }
        }
    }
}
</style>